how to find maximum element in linked list